<?php
/* 这是登录类模块 */
/* 判断是否已登录 */
function is_selog(){
	if (empty($_SESSION['uid'])) {
		$is_user = false;
	}else {
		$is_user = true;
	}
	return $is_user;
}
class member{
	function getnickname($now_user = ""){
		global $db;
		$db->ExeQuerySql("SELECT * FROM `cu_manage` WHERE username='$now_user'");
		if($db->FetchRow()){
			return  $db->Get("nickname");
		}else{
			return  "查不到昵稱！";
		}
	}
	function getroot($now_user = ""){
		global $db;
		$m_root=0;
		$db->ExeQuerySql("SELECT * FROM `cu_manage` WHERE username='$now_user'");
		if($db->FetchRow()){
			$m_root = $db->Get("root");
		}
		return $m_root;
	}
	function getpageroot($now_user = "",$page = "") {
		global $db;
		$m_root="";
		$db->ExeQuerySql("SELECT * FROM `cu_manage` WHERE username='$now_user'");
		if($db->FetchRow()){
			$m_root = $db->Get("page".$page);
			if ($m_root == 'T') {
				$m_root = true;
			}else {
				$m_root = false;
			}
		}
		return $m_root;
	}
	public static function getstartmenu($user){
		global $db;
		$xml = '<p>欢迎使用114客服综合工作流</p><p>坐席员：{nn}</p><p>技能组：{root}</p><p>操作：<a href="int.php?action=logout" >退出</a></p>';
		$db->ExeQuerySql("SELECT * FROM `cu_manage` WHERE username='$user'");
		if($db->FetchRow()){
			$trr = array(
				'{nn}'=>$db->Get("nickname")
			
			);
			$outxml = strtr($xml,$trr);
			return  $outxml;
		}else{
			return  "查不到昵稱！";
		}
	}
}